package recyclerview.zjitc.net.androidpractiserecyclerview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    RecyclerView mecyclerView;
    List<String> mList;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mecyclerView=findViewById(R.id.id_recyclerview);
        mecyclerView.setLayoutManager(new LinearLayoutManager(this));
        mList=new ArrayList<>();
        mList.add("Hello World");
        mList.add("Hello World");
        mecyclerView.setAdapter(new HomeAdapter(mList,this));
        mecyclerView.addItemDecoration(new DividerItemDecoration(MainActivity.this,DividerItemDecoration.VERTICAL));
    }
}
